package com.quanshu.shop.brocastreciver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.quanshu.shop.base.data.BroadcastReciverAction;
import com.quanshu.shop.goods.inf.CartUpdateListener;

/**
 * 作者  李哲
 * 创建时间 2018/8/6
 * 邮箱 lizhetongliao@163.com
 * 说明
 **/
public class CartUpdateBrocarstReciver extends BroadcastReceiver {
    private CartUpdateListener cartUpdateListener;

    public CartUpdateBrocarstReciver setCartUpdateListener(CartUpdateListener cartUpdateListener1) {
        cartUpdateListener = cartUpdateListener1;
        return this;
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        if (BroadcastReciverAction.UPDATE_MY_CART.equals(intent.getAction())) {
            //更新购物车回调
            if (cartUpdateListener != null) {
                cartUpdateListener.updateCart();
            }
        }
    }
}
